//
//  PhotoDetailViewController.swift
//  Photos
//
//  Created by wangqi on 2021/10/20.
//

import UIKit

class PhotoDetailViewController: UIViewController {
    
    var viewModel = PhotoDetailViewModel()
    
    @IBOutlet weak var imageView: UIImageView!
    @IBOutlet weak var titleLabel: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        setupViews()
    }
}
private extension PhotoDetailViewController {
    func setupViews() -> () {
        setupNavigationBar()
        updateViews()
    }
    func setupNavigationBar() -> () {
        title = "Photo Detail"
    }
    
}
private extension PhotoDetailViewController {
    func updateViews() -> () {
        imageView.setImage(viewModel.detail.url)
        titleLabel.text = viewModel.detail.title
    }
}


